<?php

/**
 +-----------------------------------------------------
 * PublicModel
 +-----------------------------------------------------
 * @author	liuricheng 
 * @time	2014-03-13
 * @type	[add]
 * 
 */
import("ORG.Util.Function");


class AttributeModel extends Model{
	
	// 获取属性列表
	public function getAttributeList($cat_id){
		$sql			=	" SELECT a.*, t.cat_name FROM `ybr_attribute` AS a LEFT JOIN `ybr_goods_type` AS t ON a.cat_id = t.cat_id ";
		if(empty($cat_id))
			$con		=	"";
		else 
			$con		=	" WHERE t.cat_id = '{$cat_id}' ";
		// sql
		$sql			=	$sql . $con . " ORDER BY a.attr_id desc ";	
		return $this->query($sql);
	}
	
}